package com.bsoft.gol.hcs.clinical.dao;


import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import hcn.base.PrescriptionTypeConfig;

import java.util.List;

public abstract class PrescriptionTypeConfigDAO extends HibernateSupportDelegateDAO<PrescriptionTypeConfig> {
    public PrescriptionTypeConfigDAO() {
        this.setKeyField("id");
    }

    @DAOMethod(sql = " from PrescriptionTypeConfig where objectId =:objectId and effectiveFlag = '1' ")
    public abstract List<PrescriptionTypeConfig> queryPrescriptionTypeConfig(@DAOParam("objectId") String objectId);

    @DAOMethod(sql = "from PrescriptionTypeConfig where objectId=:objectId")
    public abstract List<PrescriptionTypeConfig> queryPrescriptionTypeConfigByObjectId(@DAOParam("objectId") String objectId);

    @DAOMethod(sql = "update PrescriptionTypeConfig set effectiveFlag=:effectiveFlag where id=:id")
    public abstract void updateEffectiveFlagById(@DAOParam("id") int id, @DAOParam("effectiveFlag") String effectiveFlag);

    @DAOMethod(sql = "from PrescriptionTypeConfig where objectId=:objectId")
    public abstract List<PrescriptionTypeConfig> findPreTypeConfigByObject(@DAOParam("objectId") String objectId);
}
